// create a 4x4 matrix in the standard format
var a = new Array(4);
for (var i = 0; i< 4; i++) {
    a[i] = new Array(4);
    for (var j = 0; j <4; j++) {
         a[i][j] = i == j ? 2.3 : 0;
    }
}
var b = a;
var v = [];
var stopClock = Fug.startClock();
for (var i = 0; i < 10000; i++) {
    //i%1000 == 0 ? console.log(i) : "";
    v[i] = matrixMultiply(a, b);
}
console.log('v 1', v.length, stopClock());
console.log('****************');


// vreate 4x4 matrix in raster format
var arr = new Array(16);
for (var i = 0; i < 16; i++) {
    arr[i] = i%4 == 0 ? 2.3 : 0;
}


var mA = {
    valArray: arr,
    nRows: 4,
    mCols: 4
};

var mB = mA;
var v = [];

var stopClock = Fug.startClock();
for (var i = 0; i <10000; i++) {
    //i%1000 == 0 ? console.log(i) : "";
    v[i] = matrixMultiply2(mA, mB);
}
console.log('v 2', v.length, stopClock());


// test to rasterise a std formatted matrix
console.log(rasteriseMatrix(a));